package com.example.day01.p;

import com.example.day01.CallBack;
import com.example.day01.DataBean;
import com.example.day01.m.MainModel;
import com.example.day01.v.View;

import java.util.List;

public class Persenter implements CallBack {
    private View view;
    private MainModel mainModel;

    public Persenter(View view) {
        this.view = view;
        mainModel=new MainModel();
    }

    @Override
    public void showData(List<DataBean.ResultsBean> beans) {
        view.showData(beans);
    }

    @Override
    public void show(String s) {
        view.showToast(s);
    }
    public void getData(){
        mainModel.getData(this);
    }
}
